package com.meitianhui.convenitenbuy.module.order.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.meitianhui.convenitenbuy.R;
import com.meitianhui.convenitenbuy.module.order.model.bean.HomeServiceGood;
import com.meitianhui.convenitenbuy.util.GlideUtils;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/11/16.
 */

public class HomeServiceGoodAdapter extends BaseQuickAdapter<HomeServiceGood, BaseViewHolder> {
    private Map<String, String> mUrlMap;
    public HomeServiceGoodAdapter(@Nullable List<HomeServiceGood> data,Map<String, String> urlMap) {
        super(R.layout.item_home_service_good, data);
        mUrlMap = urlMap;
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeServiceGood item) {
        helper.setText(R.id.tv_good_name,item.getGoods_title());
        helper.setText(R.id.tv_good_price,"¥" + item.getSale_price());
        helper.setText(R.id.tv_good_num2,"x" + item.getQty());
        GlideUtils.setCircleImage(mContext,mUrlMap.get(item.getPath_id()),R.mipmap.wallet_coupon_item_default,R.mipmap.wallet_coupon_item_default,helper.getView(R.id.iv_good));
    }
}
